import { configureStore } from "@reduxjs/toolkit";
import counterReducer from "./modules/counterStore";

const store = configureStore({
  reducer: {
    // add your reducers here
    counter: counterReducer,
  },
  // 默认情况下，configureStore会自动应用redux-thunk等中间件
  // 如果你想明确指定中间件，可以如下做：
  // middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(yourCustomMiddleware),
});

export default store;

// 推荐使用类型推断
export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
